from django.db import models

# Create your models here.
"""
这个类等于sql语句： 
create table app01_userinfo(id bigint auto_increment primary key, name varchar(32), password varchar(64), age int)
"""
class UserInfo(models.Model):
    name = models.CharField(max_length=32)
    password = models.CharField(max_length=64)
    age = models.IntegerField()
    # 删除表字段，直接就注释或删除对应行，在migrations即可
    # 在已有的表上增加字段要填默认值，或者允许为空
    size = models.IntegerField(default=2)  # 设置默认值
    data = models.IntegerField(null=True, blank=True) # 字段可以为空

class Department(models.Model):
    title = models.CharField(max_length=16)
